Skip to content

Google Java Format step is not compatible with configuration cache #2459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ZacSweers opened this issue Apr 3, 2025 · 0 comments
Open
Labels

Comments

@ZacSweers
Copy link
Contributor

When running spotless with CC enabled and using predeclare, we still see this error reported:

Caused by: org.gradle.api.GradleException: Add a step with [com.google.googlejavaformat:google-java-format:1.26.0] into the `spotlessPredeclare` block in the root project.	
	at com.diffplug.gradle.spotless.GradleProvisioner$DedupingProvisioner.lambda$new$0(GradleProvisioner.java:99)	
	at com.diffplug.spotless.JarState.provisionWithTransitives(JarState.java:109)	
	at com.diffplug.spotless.JarState.from(JarState.java:98)	
	at com.diffplug.spotless.JarState.from(JarState.java:93)	
	at com.diffplug.spotless.java.GoogleJavaFormatStep.lambda$createInternally$1(GoogleJavaFormatStep.java:106)	
	at com.diffplug.spotless.JarState$Promised.get(JarState.java:53)	
	at com.diffplug.spotless.java.GoogleJavaFormatStep.equalityState(GoogleJavaFormatStep.java:152)	
	at com.diffplug.spotless.FormatterStepSerializationRoundtrip.stateSupplier(FormatterStepSerializationRoundtrip.java:57)	
	at com.diffplug.spotless.ThrowingEx.get(ThrowingEx.java:67)	
	at com.diffplug.spotless.FormatterStepSerializationRoundtrip$HackClone.writeObject(FormatterStepSerializationRoundtrip.java:113)

We are configuring GJF's formatter in our predeclare block and you can find our configuration logic here: https://github.com/slackhq/foundry/blob/5d970a56341e0cd703ab20c344f0df3a55a6c826/platforms/gradle/foundry-gradle-plugin/src/main/kotlin/foundry/gradle/FoundryBasePlugin.kt#L185-L200

@nedtwigg nedtwigg added the bug label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants